package rs.frenjoynet.core.core;

import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 18.10.2009.
 * Time: 21.37.48
 * To change this template use File | Settings | File Templates.
 */
public class FacadeFactoryImpl implements FacadeFactory
{
	@Override
	public CoreApplicationsFacade createAppComplexFacade()
	{
		try
		{
			InitialContext initialContext = new InitialContext();
			return (CoreApplicationsFacade)initialContext.lookup("java:comp/env/CoreApplicationFacadeBean");
		}
		catch (NamingException e)
		{
			throw new RuntimeException(e);
		}
	}

	@Override
	public CoreSecurityFacade createSecurityFacade()
	{
		try
		{
			InitialContext initialContext = new InitialContext();
			return (CoreSecurityFacade)initialContext.lookup("java:comp/env/CoreSecurityFacadeBean");
		}
		catch (NamingException e)
		{
			throw new RuntimeException(e);
		}
	}

}
